:root {
  color-scheme: dark;
  --bg: #10131d;
  --bg-panel: rgba(22, 26, 40, 0.9);
  --bg-panel-emph: rgba(27, 34, 52, 0.9);
  --border: rgba(110, 129, 179, 0.35);
  --text: #f3f7ff;
  --text-muted: #a5b1cc;
  --accent: #6ea8ff;
  --accent-soft: rgba(110, 168, 255, 0.18);
  --sidebar-bg: rgba(17, 21, 32, 0.92);
  --routine-bg: rgba(19, 25, 41, 0.9);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(110, 168, 255, 0.28), transparent 45%),
    radial-gradient(circle at bottom right, rgba(249, 168, 212, 0.18), transparent 40%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: var(--accent);
}

button {
  font-family: inherit;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: #2c3244;
  border-radius: 4px;
}

.layout-grid {
  display: grid;
  grid-template-columns: 240px 2.5fr 2fr;
  gap: 18px;
  padding: 24px;
  align-items: start;
}

.center-column,
.right-column {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel {
  background: linear-gradient(135deg, rgba(110, 168, 255, 0.16), transparent);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.panel-header .muted {
  display: block;
  font-size: 0.85rem;
}

.panel-body {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-body.routine {
  gap: 14px;
}

.conversation .friend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.friend-pill {
  border: 1px solid rgba(110, 168, 255, 0.35);
  background: rgba(110, 168, 255, 0.12);
  border-radius: 999px;
  padding: 6px 14px;
  color: inherit;
  cursor: pointer;
  font-size: 0.85rem;
}

.friend-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0f1320;
}

.conversation-body {
  gap: 14px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(110, 129, 179, 0.25);
  border-radius: 18px;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: rgba(19, 25, 41, 0.85);
}

.avatar-large {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(110, 168, 255, 0.4), rgba(249, 168, 212, 0.35));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 600;
}

.profile-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-details strong {
  font-size: 1rem;
}

.profile-details small {
  font-size: 0.75rem;
}

.chat-bubble {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(110, 129, 179, 0.25);
  border-radius: 16px;
  padding: 12px 16px;
  max-width: 90%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-bubble.mine {
  align-self: flex-end;
  background: rgba(110, 168, 255, 0.2);
  border-color: rgba(110, 168, 255, 0.4);
}

.chat-bubble header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.chat-bubble header strong {
  font-size: 0.9rem;
}

.chat-bubble header time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.chat-bubble p {
  margin: 0;
  white-space: pre-wrap;
}

.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.ghost.small {
  padding: 4px 8px;
  font-size: 0.8rem;
}

.ghost:hover {
  border-color: var(--accent);
}

.primary {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

.primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.timeline .event-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event-card header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: baseline;
}

.event-type {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.event-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.event-card time {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.event-content {
  background: rgba(18, 20, 28, 0.8);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.95rem;
}

.attachments {
  margin-top: 4px;
}

.attachments .link {
  padding: 4px 0;
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
}

.tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.75rem;
}

.event-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.board .column {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.board .column header {
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.task-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(15, 17, 23, 0.9);
}

.task-card h3 {
  margin: 0;
  font-size: 1rem;
}

.task-card footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-card footer .moves {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.notification-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notification-list li {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(15, 17, 23, 0.8);
}

.notification-list .title {
  font-weight: 500;
}

.notification-list .meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.drawer {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 16, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  z-index: 100;
}

.drawer-content {
  background: #121520;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  width: min(640px, 90vw);
  max-height: 90vh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-content label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}

.drawer-content textarea,
.drawer-content input {
  background: rgba(18, 19, 27, 0.9);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  color: inherit;
}

.drawer-content footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.row {
  display: flex;
  gap: 12px;
}

.row label {
  flex: 1;
}

.palette {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 10, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  z-index: 120;
}

.palette-dialog {
  background: #0f141e;
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(520px, 90vw);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.palette-dialog input {
  background: rgba(18, 19, 27, 0.9);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: inherit;
  font-size: 1rem;
}

.palette-dialog ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}

.palette-dialog li button {
  width: 100%;
  background: rgba(20, 24, 34, 0.8);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  color: inherit;
  display: flex;
  justify-content: space-between;
  cursor: pointer;
}

.palette-dialog li button:hover {
  border-color: var(--accent);
}

.palette-dialog kbd {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.75rem;
}

.attachments-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attachments-list li a {
  color: var(--accent);
  text-decoration: none;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px 0 24px;
}

.top-bar h1 {
  margin: 0;
  font-size: 1.5rem;
}

.top-actions {
  display: flex;
  gap: 12px;
}

.link {
  background: none;
  border: none;
  color: var(--accent);
  padding: 0;
  cursor: pointer;
}

@media (max-width: 1200px) {
  .layout-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }
}
.sidebar {
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

.sidebar-header h2 {
  margin: 0;
}

.sidebar-header p {
  margin: 4px 0 0;
}

.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.sidebar-item:hover {
  border-color: rgba(110, 168, 255, 0.4);
  transform: translateX(2px);
}

.sidebar-item.active {
  border-color: var(--accent);
  background: rgba(110, 168, 255, 0.18);
}

.sidebar-item strong {
  display: block;
  font-size: 0.95rem;
}

.sidebar-item small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0d101b;
  font-weight: 600;
}

.routine-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: var(--routine-bg);
  border: 1px solid rgba(110, 129, 179, 0.25);
}

.routine-avatar {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(110, 168, 255, 0.3), rgba(249, 168, 212, 0.3));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.25rem;
}

.routine-details header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.routine-details h3 {
  margin: 0;
  font-size: 1rem;
}

.routine-details time {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.routine-details p {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 0.9rem;
}
